package com.fan.dao;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.sixth.entity.Course;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Component;

import java.util.List;

/**
 * @program: self-tui-education
 * @description:
 * @author: 老范
 * @create: 2022-04-18 09:14
 **/
@Component
public interface CourseDao extends BaseMapper<Course> {
    @Select("select c.*,t.*,m.* from edu_course c join edu_teacher t on c.teacher_id = t.id join tb_member m on t.mobile = m.mobile where c.teacher_id=#{teacherId}")
    List<Course> courseAndTeachername(String id);

    @Select("select c.lesson_num,cp.* from edu_course c join edu_chapter cp on c.id=cp.course_id where c.id=#{id}")
    List<Course> findChapterById(String id);
    //  根据课程id和教师id查询发布的视频
    List<Course> queryAllById(String id, String mobile);

    com.fan.entity.Course queryMemberStatus(String id, String mobile);
}
